package com.tmzn.controller;

import com.tmzn.entity.param.BindParam;
import com.tmzn.jwt.JwtKit;
import com.tmzn.service.DeviceService;
import com.tmzn.service.UserService;
import com.tmzn.transdata.RpcResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @Autowired
    DeviceService deviceService;


    @RequestMapping("/info")
    public RpcResult info(){
        return userService.info();
    }
    @RequestMapping("/binddevice")
    public RpcResult bindDevice(@RequestBody BindParam bindParam){
        return deviceService.bindDevice(bindParam);
    }

    @RequestMapping("/modifyType")
    public RpcResult modifyType(@RequestBody BindParam bindParam){
        return deviceService.modifyDeviceType(bindParam);
    }


}
